Iterative algorithms to find spatial median, multivariate Hodges-Lehmann estimate of location, their affine equivariant versions and k-step versions of these.
spatial.location(X, score = c("sign", "signrank"), init = NULL,
shape = TRUE, steps = Inf, maxiter = 500, eps = 1e-6,
na.action = na.fail) ae.spatial.median(X, init = NULL, shape = TRUE, steps = Inf,
maxiter = 500, eps = 1e-6, na.action = na.fail)
ae.hl.estimate(X, init = NULL, shape = TRUE, steps = Inf,
maxiter = 500, eps = 1e-06, na.action = na.fail)
The estimate vector with the (final estimate of or given) shape matrix
as attribute "shape".
a matrix or a data frame
a character string indicating which transformation of the observations should be used
an optional vector giving the initial point of the iteration
logical, or a matrix. See details
fixed number of iteration steps to take, if Inf iteration is repeated until convergence (or until maxiter steps)
tolerance for convergence
maximum number of iteration steps
a function which indicates what should happen when the data contain 'NA's. Default is to fail.
Seija Sirkia, seija.sirkia@iki.fi, Jari Miettinen, jari.p.miettinen@aalto.fi
Spatial median and Hodges-Lehmann estimator (spatial median of the pairwise differences) are not affine equivariant. Affine
equivariance can be achieved by simultaneously estimating the
corresponding shape, as proposed for the spatial median by
Hettmansperger and Randles (2002). For spatial median the corresponding
shape is signs.shape and for the Hodges-Lehmann estimate it
is signrank.shape.
spatial.location is a wrapper function for a unified access to
both location estimates. The choice of estimate is done via
score:
"sign" for spatial median
"signrank" for Hodges-Lehmann estimate
If a matrix (must be symmetric and positive definite, but this is not
checked) is given as shape the location estimate is found with
respect to that shape and no further shape estimation is done. If a
logical TRUE is given as shape the shape is estimated
and consequently the affine equivariant version of the location
estimate is found. If shape is FALSE then shape
estimation is not done and the non affine equivariant versions of the
location estimate, that is the spatial median and the Hodges-Lehmann estimate are found.
Hettmansperger, T. and Randles, R. (2002) A Practical Affine Equivariant Multivariate Median, Biometrika, 89, pp. 851-860
spatial.median, signrank.shape
A<-matrix(c(1,2,-3,4,3,-2,-1,0,4),ncol=3)
X<-matrix(rnorm(3000),ncol=3)%*%t(A)
spatial.location(X,score="signrank")
spatial.location(X,score="sign")
#compare with:
colMeans(X)
ae.hl.estimate(X,shape=A%*%t(A))
ae.hl.estimate(X,shape=FALSE)
Run the code above in your browser using DataLab